package com.xudu.controller.impl;

import com.xudu.common.Result;
import com.xudu.entity.User;
import com.xudu.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: TestController
 * Description:
 *
 * @Author xudu
 * @Create 2024/4/28
 */

@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    private RedisUtils redisUtils;

    @GetMapping("test1")
    String test1(){
        return "test1……";
    }

    @GetMapping("redistoken")
    Result redisToken(User user){
        String redistoken = redisUtils.getRedisContent(user.getUsername());
        return Result.success(redistoken);

    }
}
